<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf8" />
    <title>限时抢购倒计时间表</title>
    <style type="text/css">
    *{
        margin:0;
        padding:0;
    }
    #content{
        width:300px;
        margin:0 auto;
        padding:10px;
        background:#eee;
        border:1px solid #999;
        /* background-image: url('/images/2.jpg'); */
        position: fixed;
    }
    #content h3 span{
        color:red;
        font:bold 20px Arial;
    }
    #content h3 a{
        font:12px/23px '宋体';
        color:#888;
    }
    /* .div1{ 
        display:none;
    } */
</style>
    <SCRIPT LANGUAGE="JavaScript">
    function fresh()
    {
        var endtime=new Date("2018/06/01 12:00:00");//Fri Jun 01 2018 12:00:00 GMT+0800 (中国标准时间）
        var nowtime = new Date();
        var leftsecond=parseInt((endtime.getTime()-nowtime.getTime())/1000);
        //getTime()拿到时间戳，单位是秒
        d=parseInt(leftsecond/3600/24);//天数
        h=parseInt((leftsecond/3600)%24);//小时
        m=parseInt((leftsecond/60)%60);
        s=parseInt(leftsecond%60);
     // document.getElementById("times").innerHTML=__h+"小时"+__m+"分"+__s+"秒";
        document.getElementById("times").innerHTML=d+"天"+h+"小时"+m+"分"+s+"秒";
        if(leftsecond<=0){
            document.getElementById("times").innerHTML="活动已结束！";
            clearInterval(sh);
        }
};
var sh;
sh=setInterval(fresh,1000);
</SCRIPT>
</head>
<body>
    <div id="content">
        <h1>限时抢购啦！</h1>
        <h3>倒计时：<span id="times"></span></h3>
    </div>
</body>
</html>